/*
 * 百度在线网络技术（北京）有限公司拥有本软件版权2021并保留所有权利。
 * Copyright 2021, Baidu.com,Inc 2:Baidu Online Network Technology (Beijing) Co.,Ltd,
 * All rights reserved.
 */

package com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._7创建一个工厂创造器_生成器类_通过传递形状或颜色信息来获取工厂;

import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._5为Color和Shape对象创建抽象类来获取工厂.AbstractFactory;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._6创建扩展了AbstractFactory的工厂类_基于给定的信息生成实体类的对象.ColorFactory;
import com.azdebugit.moshi.test.learn.otherfactory.test.abstrct._6创建扩展了AbstractFactory的工厂类_基于给定的信息生成实体类的对象.ShapeFactory;

public class FactoryProducer {
   public static AbstractFactory getFactory(String choice){
      if(choice.equalsIgnoreCase("SHAPE")){
         return new ShapeFactory();
      } else if(choice.equalsIgnoreCase("COLOR")){
         return new ColorFactory();
      }
      return null;
   }
}